<?php
$widget_params = isset($widget_params) ? $widget_params : [];
$choice_code_name = \Illuminate\Support\Arr::get($widget_params, 'name', 'role_id');
$choice_showAll = \Illuminate\Support\Arr::get($widget_params, 'showAll', true);
$choice_type = \Illuminate\Support\Arr::get($widget_params, 'type', 1);
$choice_all = \Illuminate\Support\Arr::get($widget_params, 'all', false);
$search = isset($search) ? $search : \Illuminate\Support\Facades\Request::all();
$choice_value = \Illuminate\Support\Arr::get($widget_params, 'value', $choice_type == 2 ? \Illuminate\Support\Arr::get($search, $choice_code_name, '') : '');
$lis = \App\Facade\System\Role::lis($choice_all);
?>

<select name="{{$choice_code_name}}" id="{{$choice_code_name}}" class="select" lay-filter="{{$choice_code_name}}">
    @if($choice_showAll)
        <option value="">{{$choice_showAll===true?__('common.all'):$choice_showAll}}</option>
    @endif
    @foreach($lis as $item)
        <option value="{{$item->id}}"
                @if($item->id==$choice_value) selected @endif itemid="{{$item->group_code}}">{{$item->name}}</option>
    @endforeach
</select>

